// 将时间(秒)显示为时分秒

export function timeToText(time) {
	time = +time;
	const formatWordArr = ["小时", "分钟", "秒"];
	const hour = Math.floor(time / 60 / 60) % 24;
	const minute = Math.floor(time / 60) % 60;
	const second = time % 60;
	const hourStr = hour ? hour + formatWordArr[0] : "";
	const minuteStr = minute ? minute + formatWordArr[1] : "";
	const secondStr = second ? second + formatWordArr[2] : "";
	return (
		hourStr +
		minuteStr +
		secondStr
	);
}